
cabecera='conectA'
amplitudes=['0.05','0.1','0.2','0.5','1','2','5','10','20','40','60','100','200']
amplitudes=['0.05','5','10','20','40','60','100','200']
amplitudes=['0.05']
dir='/home/jcfernandez/resultados/eps1/u100/AMPL/W2.0/CONNECT/TOTAL/'

fin=[]

i=0
for i in range(len(amplitudes)):
    name=dir+cabecera+amplitudes[i]+'.dat'
    print name
    for line in file(name):
        line=line.replace('\n','')
        res=[]
        val=line.split(' ')
        for v in val:
            if v!='':
                res.append(float(v))
        if res[0]>0.001: 
            fin.append(res)

fin[0][0]=0.0
step=180./(len(fin[0])-1)
for i in range(1,len(res)):
    fin[0][i]=(i-1)*step+0.5*step

matrizTranspuesta=list(zip(*fin))

f = open(dir+'salida.dat','w')
for i in range(1,len(matrizTranspuesta)):
    for j in range(len(matrizTranspuesta[i])):
        f.write(str(matrizTranspuesta[i][j])+' ')
    f.write('\n')
f.close()